<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>

<body>
    <img src="imgs/01.png" alt="这是一张图片" id="pic">
    <script>
        // 获取元素的dom对象
        var pic = document.getElementById('pic')
        /**
         * {alt:'',src:'',id:'',title:''...}
         * 
        */
        // 获取系统属性
        console.log(pic.src, pic['alt']);
        // 修改系统属性
        pic.src = 'imgs/02.png'
        pic.alt='修改之后的alt属性值'
        // 输出元素对象的详细内容
        console.dir(pic)

    </script>
</body>

</html>